// 消除   魔法字符串
const HISTORY_KEY = 'itcast_geek_h5_history'

export function getHistory () : string[] {
  return JSON.parse(localStorage.getItem(HISTORY_KEY) || '[]')
}

// 保存搜索历史记录
export function setHistory (historys: string[]) {
  localStorage.setItem(HISTORY_KEY, JSON.stringify(historys))
}

export function removeHistory () :void {
  localStorage.removeItem(HISTORY_KEY)
}
